/*    */ package cc.s2m.web.s2mBlog.task;
/*    */ 
/*    */ import cc.s2m.web.s2mBlog.pojo.AdminActions;
/*    */ import cc.s2m.web.s2mBlog.service.IAdminActions;
/*    */ import cc.s2m.web.s2mBlog.util.StaticProp;
/*    */ import java.util.List;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.scheduling.annotation.EnableScheduling;
/*    */ import org.springframework.scheduling.annotation.Scheduled;
/*    */ import org.springframework.stereotype.Component;
/*    */ 
/*    */ @Component
/*    */ @EnableScheduling
/*    */ public class ClearAdminActionsTask extends BaseTask
/*    */ {
/*    */ 
/*    */   @Autowired
/*    */   private IAdminActions adminActionsService;
/*    */ 
/*    */   @Scheduled(cron="0 */5 * * * *")
/*    */   public void run()
/*    */   {
/* 22 */     super.run();
/*    */   }
/*    */ 
/*    */   public void doTask()
/*    */   {
/* 29 */     List<AdminActions> list = this.adminActionsService.getList(new AdminActions(), null);
/* 30 */     for (AdminActions action : list) {
/* 31 */       AdminActions parent = (AdminActions)this.adminActionsService.selectByPrimaryKey(action.getPid());
/* 32 */       if ((parent == null) && (action.getPid().intValue() != 0)) {
/* 33 */         this.adminActionsService.deleteByPrimaryKey(action.getId());
/* 34 */         StaticProp.SYSTEM.info("回收无效权限{},{}", new Object[] { action.getName(), action.getUrl() });
/*    */       }
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.task.ClearAdminActionsTask
 * JD-Core Version:    0.6.1
 */